#ifndef GRAPHIC_DEVICE_SHADER_H
#define GRAPHIC_DEVICE_SHADER_H
#include "predefine.h"
#include "igobject.h"
namespace Graphic
{
	class Texture;
	//////////////////////////////////////////////////////////////////////////
	// Shaders
	//////////////////////////////////////////////////////////////////////////
	class DLL_EXPORT VertexShader : public IGObject
	{
	public:
		virtual ~VertexShader(){};
	};

	class DLL_EXPORT PixelShader : public IGObject
	{
	public:
		virtual ~PixelShader(){};
	};

	enum AttribSemantic{
		/*nvidia 
		gl_Vertex	0
		gl_Normal	2
		gl_Color	3
		gl_SecondaryColor	4
		gl_FogCoord	5
		gl_MultiTexCoord0	8
		gl_MultiTexCoord1	9
		gl_MultiTexCoord2	10
		gl_MultiTexCoord3	11
		gl_MultiTexCoord4	12
		gl_MultiTexCoord5	13
		gl_MultiTexCoord6	14
		gl_MultiTexCoord7	15
		*/

		AS_POS = 0,
		AS_NORMAL = 2,
		AS_COLOR = 3,
		AS_COLOR1 = 4,
		AS_FOGCOORD = 5,
		AS_TEXCOORD = 8,
		AS_USR_BEG = 9,
		AS_USR_END = 15 + 1,
	};

	class DLL_EXPORT ShaderParameter : public IGObject
	{
	public:
		virtual ~ShaderParameter(){};

		virtual void SetFloat(float val)		= 0;
		virtual void SetFloat2()	= 0;
		virtual void SetFloat3(float x, float y, float z)	= 0;
		virtual void SetFloat3(float* vec)					= 0;
		virtual void SetFloat4(float* vec)	= 0;

		virtual void SetInt()		= 0;
		virtual void SetInt2()		= 0;
		virtual void SetInt3()		= 0;
		virtual void SetInt4()		= 0;

		virtual void SetMatrix(float*)	= 0;

		virtual void SetTexture(int index)	= 0;
		virtual void SetTexture(int index, Texture* tex) = 0;
	};

	class DLL_EXPORT ShaderProgram : public IGObject
	{
	public:
		virtual ~ShaderProgram(){};

		virtual void AttachVertexShader(VertexShader* vs) = 0;
		virtual void AttachPixelShader(PixelShader* ps) = 0;
		virtual void SetAttribLocation(AttribLocation loc[], int size) = 0;
		virtual ShaderParameter* GetParameter(const char*) = 0;
		virtual bool Link() = 0;
		virtual void Begin() = 0;
		virtual void End() = 0;
	};
}
#endif